<?php

class App {

	function check_tables(){
		global $db;
		
		$query = "CREATE TABLE IF NOT EXISTS users (
				user_id int(9) NOT NULL AUTO_INCREMENT,
				name varchar(255) DEFAULT NULL,
				email varchar(255) DEFAULT NULL,
				password varchar(255) DEFAULT NULL,
				status int(1) NOT NULL DEFAULT 1,
				created_ip varchar(255) NOT NULL,
				created_on timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
				last_logged_ip varchar(255) DEFAULT NULL,
				last_logged_on timestamp NULL DEFAULT NULL,
				admin tinyint(1) NOT NULL DEFAULT 0,
				PRIMARY KEY (user_id));
		";
		mysql_query($query) or die(mysql_error());
	}
}